import useGlobalAPI from '@/hooks/useGlobalAPI'
import {
  MainViewContentTable,
  getTableDatas,
  MainViewNav,
  MainViewModel,
} from './components'

export default defineComponent({
  name: 'conf-role',
  setup() {
    let {route} = useGlobalAPI()
    onMounted(async () => {
      getTableDatas()
    })
    return () => {
      if (route.path === '/conf/role') {
        return (
          <div class="h-full flex flex-col">
            <MainViewNav></MainViewNav>
            <MainViewContentTable></MainViewContentTable>
            <MainViewModel></MainViewModel>
          </div>
        )
      } else {
        return <router-view></router-view>
      }
    }
  },
})
